1. Field of the Invention
This invention relates to computer systems and, more particularly, to synchronizing clocks within computer systems.
2. Description of the Related Art
Computer systems, such as personal computer systems, were originally developed for business applications such as word processing, databases and spread sheets, among others. Computer systems, however, are currently being used to handle a number of isochronous tasks including: multimedia applications having video and audio components, video capture and playback, telephony applications, and speech recognition and synthesis, among others. Generally speaking, isochronous tasks are time-dependent tasks. In other words, the data handled by an isochronous task must be delivered or processed within certain time constraints.
One problem that has arisen is that computer systems originally designed for business applications are not well suited to the time-dependent requirements of modern multimedia applications. For example, modern computer system architectures still presume that the majority of applications executed are business applications, such as word processing or spread sheet applications. Typical computer systems are inefficient at handling streams of time-dependent data, or isochronous data, that make up multimedia data types. The isochronous data of multimedia tasks require the maintenance of a temporal component. For example, audio signals may be coded as a stream of samples taken at a consistent sampling rate. The temporal relationship between these samples must be maintained to prevent perceptible errors such as gaps or altered frequencies. Likewise, the loss of the temporal relationship in a video signal can cause blank screens or lines.
To accommodate isochronous data, computer systems typically employ one or more data buses configured to handle the transfer of isochonrous data. Examples of these data buses include the Universal Serial Bus (USB), the IEEE 1394 bus, and the Audio Codec ""97 (AC ""97) bus. Unfortunately, the isochronous buses of a computer system are typically independently designed. Accordingly, the buses may have independent data rates. Further, even buses with a common data rate and devices coupled to those buses typically have independent clocks that drift relative to each other. These differences in clock rates create discrepancies in the rates at which data is generated and consumed.
Typical computer systems include buffers to accommodate the lack of synchronization and drift between the clocks of a computer system. Unfortunately, buffers add expense, size, and latency to computer systems. Therefore, it is desirable to reduce the size of the buffers within computer systems.
What is desired is a clock structure in which the various clocks of the data buses and/or devices coupled to those buses within the computer system are synchronized.
The problems outlined above are in large part solved by a master isochronous clock structure in accordance with the present invention. In one embodiment, a frame-rate clock of a plurality of data buses are synchronized to a master clock signal. The master clock signal may be derived from the existing clocks signals within the computer system or from data received from an external source. The master clock signal may also be used by an operating system scheduler to schedule task that generate or consume blocks of isochronous data.
In an alternative embodiment, the drift of a device clock signal relative to a master clock signal is measured and used to synchronize the device clock signal. For example, a mechanism may monitor the level of data in a data buffer. The level of data in the data buffer is a measure of the drift between the clock generating the data and the clock consuming the data. Based upon the level of data in the buffer, synchronization information is provided to synchronize the rates of the clock signals that generate and consume the data. In one embodiment, the level of data in a data buffer is used to synchronize the clock of a video camera. In another embodiment, the level of data in a data buffer is used to synchronize a clock of a telephony codec.
Broadly speaking, the present invention contemplates a computer system including a central processing unit (CPU), a first data bus coupled to the CPU and configured to transfer data at a first clock rate, a second data bus coupled to the CPU and configured to transfer data at a second clock rate, and a clock controller coupled to the CPU, the first data bus and the second data bus. The clock controller is configured to receive a clock signal from the first data bus and output a master clock signal to the second data bus, such that the second clock rate approximates the first clock rate.
The present invention further contemplates a computer system including: a CPU, a first data bus coupled to the CPU and configured to receive data from a first isochronous device at a first clock rate, a second data bus coupled to the CPU and configured to transfer data at a second clock rate, and a clock controller coupled to the CPU, the first data bus and the second data bus. The clock controller is configured to receive the data from the isochronous device and output a master clock signal to the second data bus, such that the second clock rate approximates the first clock rate.
The present invention still further contemplates a method of synchronizing multiple clocks in a computer system comprising: selecting a clock signal as a master clock signal; outputting the master clock signal to one or more clocks; and synchronizing the one or more clocks to the master clock signal.